/*
 * Utill.h
 *
 *  Created on: 24-03-2013
 *      Author: Jarek
 */

#ifndef UTIL_H_
#define UTIL_H_

#include "GlobalData.h"
#include "FlatShader.h"
#include <stdio.h>

class Texture;

class Util {

    enum UTIL_EXTRA
    {
    	UTIL_EXTRA_LOAD_FLAT_SHADER = 1 << 0,
    	UTIL_EXTRA_MAX
    };

    static uint				extra;
    static FlatShader*		flatShader;

private:

public:

	static double 		getTime();
	static uint			nearestPowerTwo(uint number);

	static char*		readFile(char* filePath, uint* size = NULL);

	//operation on file
	static char*		getFileName(const char* filePath);
	static char*		getPath(const char* fileDirectory, const char* fileName);

	static void			initFlatShader(char* VSpath, char* FSPath);
	static void			onDestroy();
	static void			drawQuad(const Texture& texture, GLint indicesHandle, GLint verticesHandle, GLint texcoordsHandle, Matrix4x4<float> translationMatrix = Matrix4x4<float>::getIdentity());
	static void			drawQuad(const Texture& texture, int x, int y, uint width, uint height);

};

#endif /* UTILL_H_ */
